package com.achen.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.context.annotation.Configuration;

/**
 * @author achen
 * @create 2020-04-27 22:33
 */
@Configuration
@Aspect
public class MyAspect {

    @Around("within(com.achen.service.impl.*ServiceImpl)")
    public Object around(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
        /*System.out.println("进入环绕通知");
        System.out.println("当前方法名:"+proceedingJoinPoint.getSignature().getName());
        System.out.println("参数:"+proceedingJoinPoint.getArgs());
        System.out.println("目标对象:"+proceedingJoinPoint.getTarget());*/
        //放行目标方法
        Object obj = proceedingJoinPoint.proceed(); //放行
        /*System.out.println("目标方法完成之后回到环绕通知");*/
        return obj;
    }
}
